SOAP의 개념 :: 에이젝스 일반[SSISO Community]
 
SSISO 카페 SSISO Source SSISO 구직 SSISO 쇼핑몰 SSISO 맛집
추천검색어 : JUnit   Log4j   ajax   spring   struts   struts-config.xml   Synchronized   책정보   Ajax 마스터하기   우측부분

에이젝스 일반
[1]
등록일:2008-03-21 10:39:57 (0%)
작성자:
제목:SOAP의 개념

SOAP(Simple Object Access Protocal)

  • SOAP는 한 컴퓨터에 있는 객체들을 호출하여 이용할 수 있게 해주는 XML 프로토콜이며, 분산 컴퓨팅을 수행하는 수단이 된다.
  • 한 컴퓨터에서 다른 컴퓨터로 정보를 전달할 때, 그 정보를 XML로 표현하는 표준적인 방법을 제공한다.

 

1. Request(요청)는 이렇게 합니다.

POST /mysite/test.jsp HTTP/1.1

Host: xxx.xxx.co.kr

Content-Type: text/xml

Charset="KSC5601"

Content-Length:

 

<SOAP-ENV:Envelope

xmlns:SOAP-ENV="http:schemas.xml.soap.org/soap/envelope/"

SOAP-ENV:ENCODINGStyle="http://schemas.xmlsoap.org/soap/ENCODING/">

<SOAP-ENV:BODY>

<m:testSoap xmlns:m="my-namespace">

<user_name>tester</user_name>

<nick_name>abysslover</nick_name>

</m:testSoap>

</SOAP-ENV:BODY>

</SOAP-ENV:Envelope>

 

2. 응답으로 오는 내용

HTTP/1.1 200 OK

Content-Type: text/xml

Charset="KSC5601"

Content-Length:

 

<SOAP-ENV:Envelope

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

SOAP-ENV:ENCODINGStyle="http://schemas.xmlsoap.org/soap/ENCODING/">

<SOAP-ENV:BODY>

<m:testSoapResponse xmlns:m="my-namespace">

<result>Your name is 임은천</result>

</m:testSoapResponse>

</SOAP-ENV:BODY>

</SOAP-ENV:Envelope>

 

3. 위의 내용을 실제로 전송해 보자.(자바 스크립트)

var testSoapClient = new ActiveXObject("Microsoft.XMLDOM");

var msg;

 

msg = '<?xml version="1.0"?';

msg += '

<SOAP-ENV:Envelope

xmlns:SOAP-ENV="http:schemas.xml.soap.org/soap/envelope/"

SOAP-ENV:ENCODINGStyle="http://schemas.xmlsoap.org/soap/ENCODING/">

<SOAP-ENV:BODY>

<m:testSoap xmlns:m="my-namespace">

<user_name>tester</user_name>

<nick_name>abysslover</nick_name>

</m:testSoap>

</SOAP-ENV:BODY>

</SOAP-ENV:Envelope>';

 

testSoapClient .loadXML(xml);

var msgSender = new ActiveXObject("Microsoft.XMLHTTP");

msgSender.open("POST", "/mysite/test.jsp", false);

msgSender.setRequestHeader("SOAPMethodName", "testSoap");

msgSender.setRequestHeader("Content-Type", "text/xml-SOAP");

 

msgSender.send(msg.xml);

 

var receiver = new ActiveXObject("Microsoft.XMLDOM");

receiver.loadXML(msg.responseXML.xml);

 

 

 

※ web service, UDDI, WSDL을 비롯, 좀 더 자세한 내용은 첨부파일(soap.ppt) 참고 (출저 : 구글 검색)

[출처] SOAP의 개념|작성자 아즈

[본문링크] SOAP의 개념
[1]
코멘트(이글의 트랙백 주소:/cafe/tb_receive.php?no=2953
작성자
비밀번호

 

SSISOCommunity

[이전]

Copyright byCopyright ⓒ2005, SSISO Community All Rights Reserved.